vxbPciAtaStorageK - PCI IDE host controller ATA/IDE and ATAPI CDROM vxBus storage device driver
vxbPciAtaInstInit( ) - First pass initialization
vxbPciAtaInstInit2( ) - Second pass initialization
vxbPciAtaInstConnect( ) - Final initialization
vxbPciAtaStorageRegister( ) - register driver with vxbus
ataIntr( ) - ATA/IDE controller interrupt handler.
pciAtaDrv( ) - Initialize the ATA driver
pciAtaXbdDevCreate( ) - create an XBD device for a ATA/IDE disk
pciAtaDevCreate( ) - create a device for a ATA/IDE disk
ataDriveInit( ) - initialize ATA drive
ataBlkDevFill( )( )nbsp;)" class="routine">ataBlkDevFill( )( )nbsp;)" class="routine">ataBlkDevFill( )( ) - fills block device structure
ataBlkRd( )( )nbsp;)" class="routine">ataBlkRd( )( )nbsp;)" class="routine">ataBlkRd( )( ) - reads specified blocks from the device
ataBlkWrt( ) - write one or more blocks to a ATA/IDE disk
ataBlkIoctl( ) - This routine perform the driver specific request.
ataStub( ) - block device stub
pciAtaBlkRW( ) - read or write sectors to a ATA/IDE disk.
ataReset( ) - reset a ATA/IDE disk controller
ataStatus( ) - check status of a ATA/IDE disk controller
atapiBlkWrt( ) - write one or more blocks to an ATAPI Device.
atapiBlkRd( ) - read one or more blocks from an ATAPI Device.
atapiReset( ) - reset a ATAPI drive
atapiStatusChk( ) - check device status
pciAtapiPktCmdSend( ) - Issue a Packet command.
pciAtapiIoctl( ) - Control the drive.
ataCHSPack( ) - Pack Cylinder,Head,sector values to address a sector.
ataBestTransferModeFind( ) - Justify the best transfer mode using the cycle time
ataUDmaCableChk( ) - Find the cable type.
atapiParamsPrint( ) - Print the drive parameters.
atapiBlkIoctl( ) - do device specific control function
pciAtapiCtrlMediumRemoval( ) - Issues PREVENT/ALLOW MEDIUM REMOVAL packet command
pciAtapiRead10( ) - read one or more blocks from an ATAPI Device.
pciAtapiReadCapacity( ) - issue a READ CD-ROM CAPACITY command to a ATAPI device
pciAtapiReadTocPmaAtip( ) - issue a READ TOC command to a ATAPI device
pciAtapiScan( ) - issue SCAN packet command to ATAPI drive.
pciAtapiSeek( ) - issues a SEEK packet command to drive.
pciAtapiSetCDSpeed( ) - issue SET CD SPEED packet command to ATAPI drive.
pciAtapiStopPlayScan( ) - issue STOP PLAY/SCAN packet command to ATAPI drive.
pciAtapiStartStopUnit( ) - Issues START STOP UNIT packet command
pciAtapiTestUnitRdy( ) - issue a TEST UNIT READY command to a ATAPI drive
pciAtaCmd( ) - issue a RegisterFile command to ATA/ATAPI device.
pciAtaInit( ) - initialize ATA device.
pciAtaRW( ) - read/write a data from/to required sector.
pciAtaDmaRW( ) - read/write a number of sectors on the current track in DMA mode
pciAtaPiInit( ) - init a ATAPI CD-ROM disk controller
pciAtaDevIdentify( ) - identify device
pciAtaParamRead( ) - Read drive parameters
pciAtaCtrlReset( ) - reset the specified ATA/IDE disk controller
pciAtaStatusChk( ) - Check status of drive and compare to requested status.
ataWdog( ) - ATA/IDE controller watchdog handler.
pciAtapiPktCmd( ) - execute an ATAPI command with error processing
atapiPktCmdExec( ) - execute an ATAPI command without error processing
atapiNonOverlapTransferLoop( ) - loop for DRQ Interrupts without Overlapping
atapiOverlapTransferLoop( ) - loop for DRQ Interrupts with Overlapping
atapiDmaTransfer( ) - a stub
pciAtapiInit( ) - init ATAPI CD-ROM disk controller
atapiPIOTransfer( ) - transfer a single data packet via PIO
atapiReqSense( ) - issue a REQUEST_SENSE command to a device
ataXbdDump( ) - XBD block device dump routine
ataXbdStrategy( ) - XBD block device strategy routine
ataXbdIoctl( ) - XBD block device ioctl routine
ataXbdDevCreateSyncHandler( ) - creates the handler
ataXbdMediaTest( ) - Test a block wrapper for media existence
ataXbdTest( ) - Test to see if media is present or not. If a change
ataXbdEject( ) - Eject the device and instantiate the next step
ataCoreDump( ) - write sectors to a ATA/IDE disk with ints off, no OS
ataCoreWrite( ) - write a data to disk sectors.
pciAtaXbdRawio( ) - do raw I/O access
pciAtaRawio( ) - do raw I/O access
pciAtaConfig( ) - configure an ATA drive (hard disk or cdrom drive)
pciAtaConfigInit( ) - intialize the hard disk driver
pciAtaGetCtrl( ) - get globalPciAtaDrvCtrl->ataCtrl
This is a Block Device Driver for ATA/ATAPI devices on PCI IDE host controller. It also provides neccessary functions to user for device and its features control which are not used or utilized by file system.
This driver provides standard Block Device Driver functions,(blkRd, blkWrt, ioctl, statusChk, and reset) for ATA and ATAPI devices separately as the scheme of implementation differs. These functions are implemented as ataBlkRd( ), ataBlkWrt( ), ataBlkIoctl( ), ataStatus( ) and ataReset( ) for ATA devices and atapiBlkRd( ), atapiBlkWrt( ), atapiBlkIoctl( ), atapiStatusChk( ) and atapiReset( ) for ATAPI devices. The Block Device Structure BLK_DEV is updated with these function pointers ata initialization of the driver depending on the type of the device in function pciAtaDevCreate( ).
pciAtaDrv( ), a user callable function, initializes ATA/ATAPI devices present on the specified IDE controller(either primary or secondary), which must be called once for each controller, before usage of this driver, usally called from usrRoot( )in usrConfig.c.
The routine pciAtaDevCreate( ), which is user callable function, is used to mount a logical drive on an ATAPI drive.This routine returns a pointer to BLK_DEV structure, which is used to mount the file system on the logical drive.
There are various functions provided to user, which can be classified to different catagories as device contol function, device information functions and functions meant for packet devices.
Device Control Function:
pciAtapiIoctl( ) function is used to control a device. Block Device Driver functions ataBlkIoctl( ) and atapiBlkIcotl( )functions are also routed to this function. This function implements various control command functions which are not used by the I/O system (like power managment feature set commands, host protected feature set commands, security feature set commands, media control functions etc).
Device Information Function:
In this catagory various functions are implmented depending on the information required. These functions return information required ( like cylinder count, Head count, device serial number, device Type, etc)from the internal device structures.
Packet Command Functions:
Although Block Device Driver functions deliver packet commands using functions provided by atapiLib.c for required functionality. There are group of functions provided in this driver to user for ATAPI device, which implements packet commands for CD_ROM that comply to ATAPI-SFF8020i specification which are essentially required for CD ROM operation for file system. These functions are named after their command name (like for REQUEST SENSE packet command atapiReqSense( ) function). To issue other packet commands pciAtapiPktCmdSend( ) can be used.
This driver also provides a generic function pciAtapiPktCmdSend( ) to issue a packet command to ATAPI devices, which can be utilized by user to issue packet command directly instead using the implmented functions also may be used to send new commands ( may come in later specs) to device. User can issue any packet command using pciAtapiPktCmdSend( ) function to the required device by passing its BLK_DEV structure pointer and pointer for ATAPI_CMD command packet.
typedef of ATAPI_CMD
typedef struct atapi_cmd { UINT8 cmdPkt [ATAPI_MAX_CMD_LENGTH]; char **ppBuf; UINT32 bufLength; ATA_DATA_DIR direction; UINT32 desiredTransferSize; BOOL dma; BOOL overlap; } ATAPI_CMD;and ATA_DATA_DIR typedef is
typedef enum /* with respect to host/memory */ { NON_DATA, /* non data command */ OUT_DATA, /* to drive from memory */ IN_DATA /* from drive to memory */ } ATA_DATA_DIR;User is expected supposed to fill the ATAPI_CMD structure with required parameters of the packet and pass the ATAPI_CMD structure pointer to pciAtapiPktCmdSend( ) fuuction for command execution.
All the packet command functions require ATA_DEV structure to be passed, which alternatively a BLK_DEV Device Structure of the device. One should type convert the structure and the same BLK_DEV structrue pointer to these functions.
The routine ataPiRawio( ) supports physical I/O access. The first argument is the controller number, 0 or 1; the second argument is drive number, 0 or 1; the third argument is a pointer to an ATA_RAW structure.
The ataPiDrv( ) function requires a configuration flag as a parameter. The configuration flag is one of the following or Bitwise OR of any of the following combination:
configuration flag =
Transfer mode | Transfer bits | Transfer unit | Geometry parameters
Transfer mode Description Transfer Rate ATA_PIO_DEF_0 PIO default mode ATA_PIO_DEF_1 PIO default mode, no IORDY ATA_PIO_0 PIO mode 0 3.3 MBps ATA_PIO_1 PIO mode 1 5.2 MBps ATA_PIO_2 PIO mode 2 8.3 MBps ATA_PIO_3 PIO mode 3 11.1 MBps ATA_PIO_4 PIO mode 4 16.6 MBps ATA_PIO_AUTO PIO max supported mode ATA_DMA_SINGLE_0 Single DMA mode 0 2.1 MBps ATA_DMA_SINGLE_1 Single DMA mode 1 4.2 MBps ATA_DMA_SINGLE_2 Single DMA mode 2 8.3 MBps ATA_DMA_MULTI_0 Multi word DMA mode 0 4.2 MBps ATA_DMA_MULTI_1 Multi word DMA mode 1 13.3 MBps ATA_DMA_MULTI_2 Multi word DMA mode 2 16.6 MBps ATA_DMA_ULTRA_0 Ultra DMA mode 0 16.6 MBps ATA_DMA_ULTRA_1 Ultra DMA mode 1 25.0 MBps ATA_DMA_ULTRA_2 Ultra DMA mode 2 33.3 MBps ATA_DMA_ULTRA_3 Ultra DMA mode 3 44.4 MBps ATA_DMA_ULTRA_4 Ultra DMA mode 4 66.6 MBps ATA_DMA_ULTRA_5 Ultra DMA mode 5 100.0 MBps ATA_DMA_AUTO DMA max supported mode Transfer bits ATA_BITS_16 RW bits size, 16 bits ATA_BITS_32 RW bits size, 32 bits Transfer unit ATA_PIO_SINGLE RW PIO single sector ATA_PIO_MULTI RW PIO multi sector Geometry parameters ATA_GEO_FORCE set geometry in the table ATA_GEO_PHYSICAL set physical geometry ATA_GEO_CURRENT set current geometry ISA SingleWord DMA mode is obsolete in ata-3.
The Transfer rates shown above are the Burst transfer rates. If ATA_PIO_AUTO is specified, the driver automatically chooses the maximum PIO mode supported by the device. If ATA_DMA_AUTO is specified, the driver automatically chooses the maximum Ultra DMA mode supported by the device and if the device doesn't support the Ultra DMA mode of data transfer, the driver chooses the best Multi Word DMA mode. If the device doesn't support the multiword DMA mode, driver chooses the best single word DMA mode. If the device doesn't support DMA mode, driver automatically chooses the best PIO mode. So it is recommended to specify the ATA_DMA_AUTO.
If ATA_PIO_MULTI is specified, and the device does not support it, the driver automatically chooses single sector or word mode. If ATA_BITS_32 is specified, the driver uses 32-bit transfer mode regardless of the capability of the drive. The Single word DMA mode will not be supported by the devices compliant to ATA/ATAPI-5 or higher.
This driver supports UDMA mode data transfer from device to host, provided 80 conductor cable is used for required controller device. This check done at the initilisation of the device from the device parameters and if 80 conductor cable is connected then UDMA mode transfer is selected for operation subject to condition that required UDMA mode is supported by device as well as host. This driver follows ref-3 Chapter 4 "Determining a Drive's Transfer Rate Capability" to determine drives best transfer rate for all modes ( ie UDMA, MDMA, SDMA and PIO modes).
The host IDE Bus master functions are to be mapped to follwing macro defined for various functionality in header file which are used in this driver.
ATA_HOST_CTRL_INIT - initialize the controller
ATA_HOST_DMA_ENGINE_INIT - initialize bus master DMA engine
ATA_HOST_DMA_ENGINE_START - Start bus master operation
ATA_HOST_DMA_ENGINE_STOP - Stop bus master operation
ATA_HOST_DMA_TRANSFER_CHK - check bus master data transfer complete
ATA_HOST_DMA_MODE_NEGOTIATE - get mode supported by controller
ATA_HOST_SET_DMA_RWMODE - set controller to required mode
ATA_HOST_CTRL_RESET - reset the controller
If ATA_GEO_PHYSICAL is specified, the driver uses the physical geometry parameters stored in the drive. If ATA_GEO_CURRENT is specified, the driver uses current geometry parameters initialized by BIOS. If ATA_GEO_FORCE is specified, the driver uses geometry parameters stored in sysLib.c.
The geometry parameters are stored in the structure table ataTypes[] in sysLib.c. That table has two entries, the first for drive 0, the second for drive 1. The members of the structure are:
int cylinders; /* number of cylinders */ int heads; /* number of heads */ int sectors; /* number of sectors per track */ int bytes; /* number of bytes per sector */ int precomp; /* precompensation cylinder */The driver supports two controllers and two drives on each. This is dependent on the configuration parameters supplied to ataPiDrv( ).
Most of the processing in this driver occurs in the context of a dedicated task, and therefore is inherently SMP-safe. One area of possible concurrence occurs in the interrupt service routine, ataIntr( ). An ISR-callable spin lock take/give pair has been placed around the code which acknowledges/clears the ATA controller's interrupt status register. If the BSP or application provides functions for ataIntPreProcessing or ataIntPostProcessing, consideration will have to be given to making these functions SMP-safe. Most likely, some portion(s) of these functions will need to be protected by a spin lock. The spin lock allocated for the controller can be used. Consult the SMP Migration Guide for hints.
References:
1) ATAPI-5 specification "T13-1321D Revision 1b, 7 July 1999"
2) ATAPI for CD-ROMs "SFF-8020i Revision 2.6, Jan 22,1996"
3) Intel 82801BA (ICH2), 82801AA (ICH), and 82801AB (ICH0) IDE Controller
Programmer's Reference Manual, Revision 1.0 July 2000
Source of Reference Documents:
1) ftp://ftp.t13.org/project/d1321r1b.pdf
2) http://www.bswd.com/sff8020i.pdf
VxWorks Programmer's Guide: I/O System
vxbPciAtaInstInit( ) - First pass initialization
N/A
vxbPciAtaInstInit2( ) - Second pass initialization
none
N/A
vxbPciAtaInstConnect( ) - Final initialization
none
N/A
vxbPciAtaStorageRegister( ) - register driver with vxbus
none
N/A
ataIntr( ) - ATA/IDE controller interrupt handler.
none
N/A
Not Available
pciAtaDrv( ) - Initialize the ATA driver
This routine initializes the ATA/ATAPI device driver, initializes IDE host controller and sets up interrupt vectors for requested controller. This function must be called once for each controller, before any access to drive on the controller, usually which is called by usrRoot( ) in usrConfig.c.
If it is called more than once for the same controller, it returns OK with a message display Host controller already initialized , and does nothing as already required initialization is done.
Additionally it identifies devices available on the controller and initializes depending on the type of the device (ATA or ATAPI). Initialization of device includes reading parameters of the device and configuring to the defaults.
OK, or ERROR if initialization fails.
Not Available
pciAtaXbdDevCreate( ) - create an XBD device for a ATA/IDE disk
Use the existing code to create a standard block dev device, then create an XBD device associated with the BLKDEV.
a device identifier upon success, or NULLDEV otherwise
pciAtaDevCreate( ) - create a device for a ATA/IDE disk
This routine creates a device for a specified ATA/IDE or ATAPI CDROM disk.
ctrl is a controller number for the ATA controller; the primary controller is 0. The maximum is specified via ATA_MAX_CTRLS.
drive is the drive number for the ATA hard drive; the master drive is 0. The maximum is specified via ATA_MAX_DRIVES.
The nBlocks parameter specifies the size of the device in blocks. If nBlocks is zero, the whole disk is used.
The blkOffset parameter specifies an offset, in blocks, from the start of the device to be used when writing or reading the hard disk. This offset is added to the block numbers passed by the file system during disk accesses. (VxWorks file systems always use block numbers beginning at zero for the start of a device.)
A pointer to a block device structure (BLK_DEV) or NULL if memory cannot be allocated for the device structure.
Not Available
vxbPciAtaStorageK, dosFsMkfs( ), dosFsDevInit( ), rawFsDevInit( )
ataDriveInit( ) - initialize ATA drive
This routine checks the drive presence, identifies its type, initializes the drive and driver control structures with the parameters of the drive.
OK if drive was initialized successfuly, or ERROR.
Not Available
ataBlkDevFill( )( ) - fills block device structure
This routine fills a block device structure with real parameters corresponding to the given device, or with stubs if a device is not detected by previous ataDriveInit () call. The routine considers offset and size requested for the device in pciAtaDevCreate () call.
N/A
Not Available
vxbPciAtaStorageK, pciAtaDevCreate (), ataDriveInit ()
ataBlkRd( )( ) - reads specified blocks from the device
This routine reads one or more blocks from the specified device, starting with the specified block number.
If any block offset was specified during pciAtaDevCreate( ), it is added to startBlk before the transfer takes place.
OK, ERROR if the read command didn't succeed.
Not Available
ataBlkWrt( ) - write one or more blocks to a ATA/IDE disk
This routine writes one or more blocks to the specified device, starting with the specified block number.
If any block offset was specified during pciAtaDevCreate( ), it is added to startBlk before the transfer takes place.
OK, ERROR if the write command didn't succeed.
Not Available
ataBlkIoctl( ) - This routine perform the driver specific request.
OK, ERROR and errno must be set
Not Available
Not Available
ataStub( ) - block device stub
This routine services as stub for a block device structure's routine pointers.
ERROR always.
Not Available
pciAtaBlkRW( ) - read or write sectors to a ATA/IDE disk.
Read or write sectors to a ATA/IDE disk. startBlk is the start Block, nBlks is the number of blocks, pBuf is data buffer pointer and direction is the direction either to read or write. It should be O_WRONLY for data write to drive or O_RDONLY for read data from drive.
OK, ERROR if the command didn't succeed.
Not Available
ataReset( ) - reset a ATA/IDE disk controller
This routine resets a ATA/IDE disk controller.
OK, always.
Not Available
ataStatus( ) - check status of a ATA/IDE disk controller
This routine check status of a ATA/IDE disk controller.
OK, ERROR .
Not Available
atapiBlkWrt( ) - write one or more blocks to an ATAPI Device.
This routine writes one or more blocks to the specified device, starting with the specified block number.
OK, ERROR if the write command didn't succeed.
Not Available
atapiBlkRd( ) - read one or more blocks from an ATAPI Device.
This routine reads one or more blocks from the specified device, starting with the specified block number.
OK, ERROR if the read command didn't succeed.
Not Available
atapiReset( ) - reset a ATAPI drive
This routine resets a ATAPI drive
OK, or ERROR.
Not Available
atapiStatusChk( ) - check device status
This routine issues a TEST UNIT READY command to a ATAPI device to detect a medium change. It is called by filesystems before doing open( )'s or creat( )'s.
OK or ERROR.
Not Available
pciAtapiPktCmdSend( ) - Issue a Packet command.
This function issues a packet command to specified drive.
See library file description for more details.
SENSE_NO_SENSE if success, or ERROR if not successful for any reason
Not Available
S_ioLib_DEVICE_ERROR
pciAtapiIoctl( ) - Control the drive.
This routine is used to control the drive like setting the password, putting in power save mode, locking/unlocking the drive, ejecting the medium etc. The argument function defines the ioctl command, password, and integer array is the password required or set password value for some commands. Arguments arg0, pointer arg1, pointer to pointer buffer ppBuf are commad specific.
The following commands are supported for various functionality.
- IOCTL_DIS_MASTER_PWD
Disable the master password. where 4th parameter is the master password.
- IOCTL_DIS_USER_PWD
Disable the user password.
- IOCTL_ERASE_PREPARE
Prepare the drive for erase incase the user password lost, and it is in max security mode.
- IOCTL_ENH_ERASE_UNIT_USR
Erase in enhanced mode supplying the user password.
- IOCTL_ENH_ERASE_UNIT_MSTR
Erase in enhanced mode supplying the master password.
- IOCTL_NORMAL_ERASE_UNIT_MSTR
Erase the drive in normal mode supplying the master password.
- IOCTL_NORMAL_ERASE_UNIT_USR
Erase the drive in normal mode supplying the user password.
- IOCTL_FREEZE_LOCK
Freeze lock the drive.
- IOCTL_SET_PASS_MSTR
Set the master password.
- IOCTL_SET_PASS_USR_MAX
Set the user password in Maximum security mode.
- IOCTL_SET_PASS_USR_HIGH
Set the user password in High security mode.
- IOCTL_UNLOCK_MSTR
Unlock the master password.
- IOCTL_UNLOCK_USR
Unlock the user password.
- IOCTL_CHECK_POWER_MODE
Find the drive power saving mode.
- IOCTL_IDLE_IMMEDIATE
Idle the drive immediatly. this will get the drive from the standby or active mode to idle mode immediatly.
- IOCTL_SLEEP
Set the drive in sleep mode. this is the highest power saving mode. to return to the normal active or IDLE mode, drive need an hardware reset or power on reset or device reset command.
- IOCTL_STANDBY_IMMEDIATE
Standby the drive immediatly.
- IOCTL_EJECT_DISK
Eject the media of an ATA drive. Use IOsystem ioctl function for ATAPI drive.
- IOCTL_GET_MEDIA_STATUS
Find the media status.
- IOCTL_ENA_REMOVE_NOTIFY
Enable the drive's removable media notification feature set.
The following table describes these arguments validity. These are tabulated in the following form
---------------------------------------------------------------------- FUNCTION password [16] arg0 *arg1 **ppBuf ---------------------------------------------------------------------- IOCTL_DIS_MASTER_PWD password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_DIS_USER_PWD password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_ERASE_PREPARE ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_ENH_ERASE_UNIT_USR password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_ENH_ERASE_UNIT_MSTR password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_NORMAL_ERASE_UNIT_MSTR password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_NORMAL_ERASE_UNIT_USR password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_FREEZE_LOCK ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SET_PASS_MSTR password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SET_PASS_USR_MAX password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SET_PASS_USR_HIGH password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_UNLOCK_MSTR password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_UNLOCK_USR password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_READ_NATIVE_MAX_ADDRESS - it returns address in <arg1> ATA_ZERO (ATA_SDH_IBM or LBA/CHS add ATA_ZERO ATA_SDH_LBA ) ( LBA 27:24 / Head LBA 23:16 / cylHi LBA 15:8 / cylLow LBA 7:0 / sector no ) IOCTL_SET_MAX_ADDRESS - <arg1> is pointer to LBA address ATA_ZERO SET_MAX_VOLATILE or LBA address ATA_ZERO SET_MAX_NON_VOLATILE IOCTL_SET_MAX_SET_PASS password ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SET_MAX_LOCK ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SET_MAX_UNLOCK ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SET_MAX_FREEZE_LOCK ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_CHECK_POWER_MODE - returns power mode in <arg1> ATA_ZERO ATA_ZERO returns power ATA_ZERO mode power modes :-1) 0x00 Device in standby mode 2) 0x80 Device in Idle mode 3) 0xff Device in Active or Idle mode IOCTL_IDLE_IMMEDIATE ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SLEEP ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_STANDBY_IMMEDIATE ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_ENB_POW_UP_STDBY ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_ENB_SET_ADV_POW_MNGMNT ATA_ZERO arg0 ATA_ZERO ATA_ZERO NOTE:- arg0 value - 1). for minimum power consumption with standby 0x01h 2). for minimum power consumption without standby 0x01h 3). for maximum performance 0xFEh IOCTL_DISABLE_ADV_POW_MNGMNT ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_EJECT_DISK ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_LOAD_DISK ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_MEDIA_LOCK ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_MEDIA_UNLOCK ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_GET_MEDIA_STATUS - returns status in <arg1> ATA_ZERO ATA_ZERO status ATA_ZERO NOTE: value in <arg1> is 0x04 -Command aborted 0x02 -No media in drive 0x08 -Media change is requested 0x20 -Media changed 0x40 -Write Protected IOCTL_ENA_REMOVE_NOTIFY ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_DISABLE_REMOVE_NOTIFY ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SMART_DISABLE_OPER ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SMART_ENABLE_ATTRIB_AUTO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SMART_DISABLE_ATTRIB_AUTO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SMART_ENABLE_OPER ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SMART_OFFLINE_IMMED ATA_ZERO SubCommand ATA_ZERO ATA_ZERO (refer to ref1 page no 190) IOCTL_SMART_READ_DATA - returns pointer to pointer <ppBuf> of read data ATA_ZERO ATA_ZERO ATA_ZERO read data IOCTL_SMART_READ_LOG_SECTOR - returns pointer to pointer <ppBuf>of read data ATA_ZERO no of sector to log Address read data be read IOCTL_SMART_RETURN_STATUS ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SMART_SAVE_ATTRIB ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_SMART_WRITE_LOG_SECTOR ATA_ZERO no of to be written Log Sector address write data NOTE: - <ppBuf> contains pointer to pointer data buffer to be written IOCTL_CFA_ERASE_SECTORS ATA_ZERO sector count PackedCHS/LBA ATA_ZERO IOCTL_CFA_REQUEST_EXTENDED_ERROR_CODE ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO IOCTL_CFA_TRANSLATE_SECTOR - <ppbuf> returns pointer to data pointer. ATA_ZERO ATA_ZERO PackedLBA/CHS read data IOCTL_CFA_WRITE_MULTIPLE_WITHOUT_ERASE ATA_ZERO sector count PackedCHS/LBA write data NOTE: -<pbuf> contains pointer to data pointer. IOCTL_CFA_WRITE_SECTORS_WITHOUT_ERASE ATA_ZERO sector count PackedCHS/LBA write data
OK or ERROR
Not Available
ataCHSPack( ) - Pack Cylinder,Head,sector values to address a sector.
This routine packes all the 3 parameters (cylinder, head, sector number) to a single 32 bit word to adress a sector on the drive.
OK.
Not Available
ataBestTransferModeFind( ) - Justify the best transfer mode using the cycle time
none
N/A.
Not Available
ataUDmaCableChk( ) - Find the cable type.
This routine will find the cable type used for specified controller and device. If a 40 conductor cable is connected uDmaCableOkay flag is made FALSE and if 80 conductor cable using 40 pin connector is set to TRUE of ataCtrl.
OK
Not Available
atapiParamsPrint( ) - Print the drive parameters.
This user callable routine will read the current parameters from the corresponding drive and will print the specified range of parameters on the console.
N/A.
Not Available
atapiBlkIoctl( ) - do device specific control function
This routine is called when the file system cannot handle an ioctl( ) function.
Functions :
Play CD - ATAPI_CMD_PLAY_CD_LBA
Set CD Speed - ATAPI_CMD_SET_CD_SPEED
OK or ERROR.
Not Available
pciAtapiCtrlMediumRemoval( ) - Issues PREVENT/ALLOW MEDIUM REMOVAL packet command
This function issues a command to drive to PREVENT or ALLOW MEDIA removal. Argument arg0 selects to LOCK_EJECT or UNLOCK_EJECT.
To lock media eject arg0 should be LOCK_EJECT To unload media eject arg0 should be UNLOCK_EJECT
OK or ERROR
Not Available
Not Available
pciAtapiRead10( ) - read one or more blocks from an ATAPI Device.
This routine reads one or more blocks from the specified device, starting with the specified block number.
The name of this routine relates to the SFF-8090i (Mt. Fuji), used for DVD-ROM, and indicates that the entire packet command uses 10 bytes, rather than the normal 12.
OK, ERROR if the read command didn't succeed.
Not Available
pciAtapiReadCapacity( ) - issue a READ CD-ROM CAPACITY command to a ATAPI device
This routine issues a READ CD-ROM CAPACITY command to a specified ATAPI device.
OK, or ERROR if the command fails.
Not Available
Not Available
pciAtapiReadTocPmaAtip( ) - issue a READ TOC command to a ATAPI device
This routine issues a READ TOC command to a specified ATAPI device.
OK, or ERROR if the command fails.
Not Available
Not Available
pciAtapiScan( ) - issue SCAN packet command to ATAPI drive.
This function issues SCAN packet command to ATAPI drive. The function argument should be 0x00 for fast forward and 0x10 for fast reversed operation.
OK or ERROR
Not Available
Not Available
pciAtapiSeek( ) - issues a SEEK packet command to drive.
This function issues a SEEK packet command (not ATA SEEK command) to the specified drive.
OK or ERROR
Not Available
Not Available
pciAtapiSetCDSpeed( ) - issue SET CD SPEED packet command to ATAPI drive.
This function issues SET CD SPEED packet command to ATAPI drive while reading and writing of ATAPI drive(CD-ROM) data. The arguments readDriveSpeed and writeDriveSpeed are in Kbytes/Second.
OK or ERROR
Not Available
Not Available
pciAtapiStopPlayScan( ) - issue STOP PLAY/SCAN packet command to ATAPI drive.
OK or ERROR
Not Available
Not Available
pciAtapiStartStopUnit( ) - Issues START STOP UNIT packet command
This function issues a command to drive to MEDIA EJECT and MEDIA LOAD. Argument arg0 selects to EJECT or LOAD.
To eject media arg0 should be EJECT_DISK To load media arg0 should be LOAD_DISK
OK or ERROR
Not Available
Not Available
pciAtapiTestUnitRdy( ) - issue a TEST UNIT READY command to a ATAPI drive
This routine issues a TEST UNIT READY command to a specified ATAPI drive.
OK, or ERROR if the command fails.
Not Available
pciAtaCmd( ) - issue a RegisterFile command to ATA/ATAPI device.
This function executes ATA command to ATA/ATAPI devices specified by arguments ctrl and drive. cmd is command to be executed and other arguments arg0 to arg5 are interpreted for differently in each case depending on the cmd command. Some commands (like ATA_CMD_SET_FEATURE) have sub commands the case in which arg0 is interpreted as subcommand and arg1 is subcommand specific.
In general these arguments arg0 to arg5 are interpreted as command registers of the device as mentioned below.
- arg0 - Feature Register
- arg1 - Sector count
- arg2 - Sector number
- arg3 - CylLo
- arg4 - CylHi
- arg5 - sdh Register
As these registers are interpreted for different purpose for each command, arguments are not named after registers.
The following commands are valid in this function and the validity of each argument for different commands. Each command is tabulated in the form
--------------------------------------------------------------------- COMMAND ARG0 | ARG1 | ARG2 | ARG3 | ARG4 | ARG5 --------------------------------------------------------------------- ATA_CMD_INITP 0 0 0 0 0 0 ATA_CMD_RECALIB 0 0 0 0 0 0 ATA_PI_CMD_SRST 0 0 0 0 0 0 ATA_CMD_EXECUTE_DEVICE_DIAGNOSTIC 0 0 0 0 0 0 ATA_CMD_SEEK cylinder head 0 0 0 0 or LBA high LBA low ATA_CMD_SET_FEATURE FR SC 0 0 0 0 (SUBCOMMAND) (SubCommand Specific Value) ATA_CMD_SET_MULTI sectors per block 0 0 0 0 0 ATA_CMD_IDLE SC 0 0 0 0 0 (Timer Period) ATA_CMD_STANDBY SC 0 0 0 0 0 (Timer Period) ATA_CMD_STANDBY_IMMEDIATE 0 0 0 0 0 0 ATA_CMD_SLEEP 0 0 0 0 0 0 ATA_CMD_CHECK_POWER_MODE 0 0 0 0 0 0 ATA_CMD_IDLE_IMMEDIATE 0 0 0 0 0 0 ATA_CMD_SECURITY_DISABLE_PASSWORD ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_CMD_SECURITY_ERASE_PREPARE 0 0 0 0 0 0 ATA_CMD_SECURITY_ERASE_UNIT ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_CMD_SECURITY_FREEZE_LOCK 0 0 0 0 0 0 ATA_CMD_SECURITY_SET_PASSWORD 0 0 0 0 0 0 ATA_CMD_SECURITY_UNLOCK 0 0 0 0 0 0 ATA_CMD_SMART (not implemented) FR SC SN ATA_ZERO ATA_ZERO ATA_ZERO (SUBCOMMAND) (SubCommand (SubCommand Specific Value) Specific Value) ATA_CMD_GET_MEDIA_STATUS 0 0 0 0 0 0 ATA_CMD_MEDIA_EJECT 0 0 0 0 0 0 ATA_CMD_MEDIA_LOCK 0 0 0 0 0 0 ATA_CMD_MEDIA_UNLOCK 0 0 0 0 0 0 ATA_CMD_CFA_ERASE_SECTORS 0 0 0 0 0 0 ATA_CMD_CFA_WRITE_SECTORS_WITHOUT_ERASE ATA_ZERO SC ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_CMD_CFA_WRITE_SECTORS_WITHOUT_ERASE ATA_ZERO SC ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_CMD_CFA_TRANSLATE_SECTOR ATA_ZERO ATA_ZERO SN cylLo cylHi DH ATA_CMD_CFA_REQUEST_EXTENDED_ERROR_CODE ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_CMD_SET_MAX FR ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO (SUBCOMMAND)The following are the subcommands valid for ATA_CMD_SET_MAX and are tabulated as below
--------------------------------------------------------------------- SUBCOMMAND(in ARG0) ARG1 | ARG2 | ARG3 | ARG4 | ARG5 --------------------------------------------------------------------- ATA_SUB_SET_MAX_ADDRESS SC sector no cylLo cylHi head + modebit (SET_MAX_VOLATILE or SET_MAX_NON_VOLATILE) ATA_SUB_SET_MAX_SET_PASS ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_SUB_SET_MAX_LOCK ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_SUB_SET_MAX_UNLOCK ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_SUB_SET_MAX_FREEZE_LOCK ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZEROIn ATA_CMD_SET_FEATURE subcommand only arg0 and arg1 are valid, all other are ATA_ZERO.
------------------------------------------------------ SUBCOMMAND(ARG0) ARG1 ------------------------------------------------------ ATA_SUB_ENABLE_8BIT ATA_ZERO ATA_SUB_ENABLE_WCACHE ATA_ZERO ATA_SUB_SET_RWMODE mode (see page no 168 table 28 in atapi Spec5 ) ATA_SUB_ENB_ADV_POW_MNGMNT 0x90 ATA_SUB_ENB_POW_UP_STDBY ATA_ZERO ATA_SUB_POW_UP_STDBY_SPIN ATA_ZERO ATA_SUB_BOOTMETHOD ATA_ZERO ATA_SUB_ENA_CFA_POW_MOD1 ATA_ZERO ATA_SUB_DISABLE_NOTIFY ATA_ZERO ATA_SUB_DISABLE_RETRY ATA_ZERO ATA_SUB_SET_LENGTH ATA_ZERO ATA_SUB_SET_CACHE ATA_ZERO ATA_SUB_DISABLE_LOOK ATA_ZERO ATA_SUB_ENA_INTR_RELEASE ATA_ZERO ATA_SUB_ENA_SERV_INTR ATA_ZERO ATA_SUB_DISABLE_REVE ATA_ZERO ATA_SUB_DISABLE_ECC ATA_ZERO ATA_SUB_DISABLE_8BIT ATA_ZERO ATA_SUB_DISABLE_WCACHE ATA_ZERO ATA_SUB_DIS_ADV_POW_MNGMT ATA_ZERO ATA_SUB_DISB_POW_UP_STDBY ATA_ZERO ATA_SUB_ENABLE_ECC ATA_ZERO ATA_SUB_BOOTMETHOD_REPORT ATA_ZERO ATA_SUB_DIS_CFA_POW_MOD1 ATA_ZERO ATA_SUB_ENABLE_NOTIFY ATA_ZERO ATA_SUB_ENABLE_RETRY ATA_ZERO ATA_SUB_ENABLE_LOOK ATA_ZERO ATA_SUB_SET_PREFETCH ATA_ZERO ATA_SUB_SET_4BYTES ATA_ZERO ATA_SUB_ENABLE_REVE ATA_ZERO ATA_SUB_DIS_INTR_RELEASE ATA_ZERO ATA_SUB_DIS_SERV_INTR ATA_ZERO
OK, ERROR if the command didn't succeed.
Not Available
pciAtaInit( ) - initialize ATA device.
This routine issues a soft reset command to ATA device for initialization.
OK, ERROR if the command didn't succeed.
Not Available
pciAtaRW( ) - read/write a data from/to required sector.
Read/write a number of sectors on the current track
OK, ERROR if the command didn't succeed.
Not Available
pciAtaDmaRW( ) - read/write a number of sectors on the current track in DMA mode
Read/write a number of sectors on the current track in DMA mode
OK, ERROR if the command didn't succeed.
Not Available
pciAtaPiInit( ) - init a ATAPI CD-ROM disk controller
This routine resets a ATAPI CD-ROM disk controller.
OK, ERROR if the command didn't succeed.
Not Available
pciAtaDevIdentify( ) - identify device
This routine checks whether the device is connected to the controller, if it is, this routine determines drive type. The routine set type field in the corresponding ATA_DRIVE structure. If device identification failed, the routine set state field in the corresponding ATA_DRIVE structure to ATA_DEV_NONE.
TRUE if a device present, FALSE otherwise
Not Available
pciAtaParamRead( ) - Read drive parameters
Read drive parameters.
OK, ERROR if the command didn't succeed.
Not Available
pciAtaCtrlReset( ) - reset the specified ATA/IDE disk controller
This routine resets the ATA controller specified by ctrl. The device control register is written with SRST=1
OK, ERROR if the command didn't succeed.
Not Available
pciAtaStatusChk( ) - Check status of drive and compare to requested status.
Wait until the drive is ready.
OK, ERROR if the drive status check times out.
Not Available
ataWdog( ) - ATA/IDE controller watchdog handler.
none
N/A
Not Available
pciAtapiPktCmd( ) - execute an ATAPI command with error processing
This routine executes a single ATAPI command, checks the command completion status and tries to recover if an error encountered during command execution at any stage.
SENSE_NO_SENSE if success, or ERROR if not successful for any reason.
Not Available
S_ioLib_DEVICE_ERROR
atapiPktCmdExec( ) - execute an ATAPI command without error processing
This routine executes a single ATAPI command without checking of completion status, and attempts to recover. An invoking routine is responsible for error processing.
OK, or ERROR if an error is encountered during data transfer.
Not Available
S_ioLib_DEVICE_ERROR
atapiNonOverlapTransferLoop( ) - loop for DRQ Interrupts without Overlapping
This routine loop for Data Request Interrupts until all data packets are transferred. It invoked when pciAtapiPktCmd( ) executes a NON Overlapped command.
OK, or ERROR
Not Available
Not Available
atapiOverlapTransferLoop( ) - loop for DRQ Interrupts with Overlapping
This routine loop for Data Request Interrupts until all data packets are transferred. It invoked when pciAtapiPktCmd( ) executes an Overlapped command. When Device executes an Overlapped command, it releases the ATA bus until the device is ready to transfer a data or to present the completion status.
OK, or ERROR
Not Available
Not Available
atapiDmaTransfer( ) - a stub
OK
Not Available
Not Available
vxbPciAtaStorageK, atapiPioTransfer( )
pciAtapiInit( ) - init ATAPI CD-ROM disk controller
This routine resets the ATAPI CD-ROM disk controller.
OK, ERROR if the command didn't succeed.
Not Available
atapiPIOTransfer( ) - transfer a single data packet via PIO
This routine transfers a single data packet via PIO.
OK, or ERROR
Not Available
Not Available
vxbPciAtaStorageK, atapiDMATransfer( )
atapiReqSense( ) - issue a REQUEST_SENSE command to a device
This routine issues a REQUEST_SENSE command to a specified ATAPI device and read the results.
OK, or ERROR if the command fails.
Not Available
ataXbdDump( ) - XBD block device dump routine
/NOMANUAL
Not Available
Not Available
ataXbdStrategy( ) - XBD block device strategy routine
/NOMANUAL
Not Available
Not Available
ataXbdIoctl( ) - XBD block device ioctl routine
/NOMANUAL
Not Available
Not Available
ataXbdDevCreateSyncHandler( ) - creates the handler
/NOMANUAL
Not Available
Not Available
ataXbdMediaTest( ) - Test a block wrapper for media existence
/NOMANUAL
Not Available
Not Available
ataXbdTest( ) - Test to see if media is present or not. If a change
of media has occurred, test XBD's for 0 size and eject
the device and instantiate the next device accordingly.
/NOMANUAL
Not Available
Not Available
ataXbdEject( ) - Eject the device and instantiate the next step
/NOMANUAL
Not Available
Not Available
ataCoreDump( ) - write sectors to a ATA/IDE disk with ints off, no OS
Write sectors to a ATA/IDE disk without using any OS services and with interrupts off.
pDev pointer to device.
startBlk is the start Block,
nBlks is the number of blocks,
pBuf is data buffer pointer
OK, ERROR if the command didn't succeed.
Not Available
ataCoreWrite( ) - write a data to disk sectors.
write a number of sectors to the disk with interrupts off
OK, ERROR if the command didn't succeed.
Not Available
pciAtaXbdRawio( ) - do raw I/O access
This routine is called to perform raw I/O access.
device is the XBD device identifier for the drive sector starting sector for I/O operation numSecs number of sectors to read/write data pointer to data buffer dir read or write
The pAtaRaw is a pointer to the structure ATA_RAW which is defined in pciAtaDrv.h.
OK, or ERROR if the parameters are not valid.
Not Available
pciAtaRawio( ) - do raw I/O access
This routine is called to perform raw I/O access.
drive is a drive number for the hard drive: it must be 0 or 1.
The pAtaRaw is a pointer to the structure ATA_RAW which is defined in pciAtaDrv.h.
OK, or ERROR if the parameters are not valid.
Not Available
pciAtaConfig( ) - configure an ATA drive (hard disk or cdrom drive)
This routine configures an ATA hard disk. Parameters:
- drive
the drive number of the hard disk; 0 is C: and 1 is D:.
- devName
the mount point for all partitions which are expected to be present on the disk, separated with commas, for example "/ata0,/ata1" or "C:,D:". Blanks are not allowed in this string.
OK or ERROR.
Not Available
vxbPciAtaStorageK, src/config/usrAta.c, VxWorks Programmer's Guide: I/O System, Local File Systems, Intel i386/i486/Pentium
pciAtaConfigInit( ) - intialize the hard disk driver
This routine is called from usrConfig.c to initialize the hard drive.
Not Available
Not Available
pciAtaGetCtrl( ) - get globalPciAtaDrvCtrl->ataCtrl
This routine is called from mkboot.c ,when makes the bootable hard drive.
Not Available
Not Available